package cn.iocoder.yudao.module.trade.service.order.handler;

import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO;
import cn.iocoder.yudao.module.trade.service.drainage.AbstractDrainageService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class DrainageOrderHandler implements TradeOrderHandler {

    @Resource
    private AbstractDrainageService drainageService;

    @Override
    public void afterPayOrder(TradeOrderDO order, List<TradeOrderItemDO> orderItems) {
        drainageService.drainagePostBack(order);
    }

    /**
     * 订单创建后
     *
     * @param order 订单
     * @param orderItems 订单项
     */
    @Override
    public void afterOrderCreate(TradeOrderDO order, List<TradeOrderItemDO> orderItems) {
        //drainageService.unPayOrderPostBack(order);
    }
}
